
/******************************************************************************/
/*----------------------------------Includes----------------------------------*/
/******************************************************************************/
#include "common_platform.h"

/******************************************************************************/
/*-----------------------------------Macros-----------------------------------*/
/******************************************************************************/

/******************************************************************************/
/*------------------------------Global variables------------------------------*/
/******************************************************************************/

/******************************************************************************/
/*------------------------------Static variables------------------------------*/
/******************************************************************************/

/******************************************************************************/
/*-------------------------Function Prototypes--------------------------------*/
/******************************************************************************/

/******************************************************************************/
/*-------------------------_Globale Function----------------------------------*/
/******************************************************************************/
//SpiIf_Status hb_SpiMaster_getStatus(void) {

//  SpiIf_Status status;
//  // TODO: adapt to customer
//  /*
//  IfxQspi_SpiMaster_Channel *chHandle = IfxQspi_GetChannel(MASTER_QSPI0_CH1);
//  status = IfxQspi_SpiMaster_getStatus(chHandle);
//  */
//  return status;
//}

//SpiIf_Status hb_SpiMaster_exchange(const void *src, void *dest, uint32 count) {
//  SpiIf_Status status;
//  // TODO: adapt to customer
//  /* 
//  IfxQspi_SpiMaster_Channel *chHandle = IfxQspi_GetChannel(MASTER_QSPI0_CH1);
//  status = IfxQspi_SpiMaster_exchange(chHandle, src, dest, count);
//  */
//  return status;
//}

//void hb_masterPrepareNotify(void) {
//  // TODO: adapt to customer
//  /*
//  Dio_WriteChannel(DioConf_DioChannel_SPI_MCU_INT, (Dio_PortLevelType)STD_LOW);
//  Dio_WriteChannel(DioConf_DioChannel_SPI_MCU_INT, (Dio_PortLevelType)STD_HIGH);
//  */
//  return;
//}

// memory control
void *hb_memset(void *s, int c, uint32 n) {
  int i = 0;
  char *ss = (char *)s;

  for (i = 0; i < n; i++)
    ss[i] = c;
  return s;
}

void *hb_memcpy(void *dest, const void *src, uint32 n) {
  int i = 0;
  char *d = (char *)dest;
  const char *s = (char *)src;

  for (i = 0; i < n; i++)
    d[i] = s[i];
  return dest;
}

int hb_memcmp(const void *cs, const void *ct, uint32 count) {
  const unsigned char *su1, *su2;
  int res = 0;

  for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
    if ((res = *su1 - *su2) != 0)
      break;
  return res;
}

int hb_strcmp(const char *cs, const char *ct) {
  unsigned char c1, c2;

  while (1) {
    c1 = *cs++;
    c2 = *ct++;
    if (c1 != c2)
      return c1 < c2 ? -1 : 1;
    if (!c1)
      break;
  }

  return 0;
}

uint32 hb_strlen(const char *s) {
  const char *sc;

  for (sc = s; *sc != '\0'; ++sc)
    /* nothing */;
  return sc - s;
}

/******************************************************************************/
/*---------------------------Static Function----------------------------------*/
/******************************************************************************/
